﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BEPUphysics.Entities;
 

namespace PloobsEngine.Physics.Bepu
{
    public class CompoundObject : BepuEntityObject
    {
        CompoundBody cb1 = new CompoundBody();
        public CompoundObject(List<BEPUphysics.Entities.Entity> entidades, float mass)
            : base(mass)
        {
            
            foreach (var item in entidades)
	        {
                cb1.AddBody(item);                
	        }
            entity = cb1;                        
        }

        public List<BEPUphysics.Entities.Entity> GetChilds()
        {
            List<BEPUphysics.Entities.Entity> resp = new List<BEPUphysics.Entities.Entity>();
            cb1.GetAllRealChildren(resp);
            return resp;
        }

        public override PhysicObjectTypes PhysicObjectTypes
        {
            get { return PhysicObjectTypes.COMPOUNDOBJECT; }
        }
        

    }
}
